-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial disk mode support #401
Conversation
9395649
to
61a3d82
Compare
Codecov Report
@@ Coverage Diff @@
## master #401 +/- ##
==========================================
+ Coverage 73.87% 74.22% +0.35%
==========================================
Files 31 32 +1
Lines 4685 5378 +693
Branches 1467 1680 +213
==========================================
+ Hits 3461 3992 +531
- Misses 734 823 +89
- Partials 490 563 +73
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
2f070d5
to
53e9696
Compare
This PR introduces a "disk-mode" for dqlite where the main SQLite database is disk-mode is considered experimental. Users can try it out and report any Design considerations:
Known limitations:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just skimmed the diff and left a comment. Overall, I like the clear-cut in the vfs.c
implementation, where the new disk mode does not mix with the the old in-memory mode, so we can experiment without the risk of regression.
I'll try to give a closer look in the next days.
53e9696
to
beea17f
Compare
beea17f
to
8500ef3
Compare
I believe supporting disk mode as a global on/off switch (vs a per-database one) is fine. We don't support multiple databases anyway at the moment I think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, with the caveats already explained in the PR description.
Thanks, I thought we did support multiple databases, I tested out a few cases and it appeared to be working (might have been a lucky shot, don't know). Will give it a closer look. |
I've run a Jepsen test-suite run against this branch and noticed a - very - frequent failure, will try to figure it out first before merging this, will convert to Draft to inhibit accidental merge. |
It's kind of surprising, given the code here: https://github.com/canonical/dqlite/blob/master/src/gateway.c#L130 but perhaps it works when using different connections. |
Indeed, when using multiple connections. |
Could it be that the event look gets blocked for too long? For example when a checkpoint happens I'd expect the event loop to be blocked for a relatively long time, since we might need to write as many as 1000 pages to disk (the default checkpoint threshold is 1000). Just thinking loud. |
I first made the implementation with sync snapshots and later converted to async snapshots, but I did a sloppy job and raft copies the WAL in a uv worker thread while it is actively being written, while it should have copied the WAL in the main thread. Fixing it. |
8500ef3
to
17ff3ab
Compare
Jepsen tests are looking good, still investigating a failure that occurs with the disk-nemesis, possibly not a bug in this PR but in managing the behaviour when a raft node converts to |
Signed-off-by: Mathieu Borderé <[email protected]>
The directory will be used to store the SQLite database. Signed-off-by: Mathieu Borderé <[email protected]>
Signed-off-by: Mathieu Borderé <[email protected]>
Signed-off-by: Mathieu Borderé <[email protected]>
Signed-off-by: Mathieu Borderé <[email protected]>
17ff3ab
to
b838f0f
Compare
The remaining failure in the Jepsen suite is related to canonical/go-dqlite#213 . |
I think this can be merged. The failure looks not to be related to this PR. |
WIP - don't review